<?php
/*
 * @Author: 莫极通
 * @Phone: 13450159681
 * @Description: 
 * @Date: 2025-02-11 14:46:03
 * @LastEditTime: 2025-02-19 17:24:10
 */

namespace app\index\controller;

use think\exception\ValidateException;
use app\model\ArticleCategory;


class ArticlecategoryController extends Base
{

    public function list()
    {

        $where['weid'] = weid();
        $data = ArticleCategory::where($where)
            ->order('sort asc')
            ->select()
            ->toArray();

        foreach ($data as &$vo) {
            $vo['icon'] = toimg($vo['image']);
        }
        unset($vo);
        array_unshift($data, ['id' => 0, 'title' => '全部']);
        return $this->json(['data' => $data]);
    }
}
